<?php

abstract class Forwarder implements IForwarder{
    protected $controller;
    protected $cache;
    
    public function __construct(HttpController $controller,$cache = null) {
        $this->controller = $controller;
        $this->cache = $cache;
    }
    
    public abstract function exec($page,  HttpRequest $request);
    
    public function execForward($page,HttpRequest $request) {
        //Put here code
        $this->exec($page, $request);
        $this->controller->execForward($page, $request);
    }
    
    public function addToCache($name,$value){
        $this->cache[$name] = $value;
    }
    
    public function getCacheValue($name){
        return $this->cache[$name];
    }
}

